package com.xs.designs.observer;

public class Main {

	/**
	 * 观察者
	 * @param args
	 */
	public static void main(String[] args) {
		Subject subject = new ConcreteSubject();
		Observer ob1 = new ConcreteObserver("ob1");
		Observer ob2 = new ConcreteObserver("ob2");
		Observer ob3 = new ConcreteObserver("ob3");
		subject.attach(ob1);
		subject.attach(ob2);
		subject.attach(ob3);

		subject.notifyObservers("徐庶666");
		subject.detach(ob3);
	}

}
